package com.gun.management.module.raffle.controller.app.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;

@Schema(description = "APP -  收货地址 Request VO")
@Data
@ToString(callSuper = true)
public class AppAddressReqVO extends Object {

    // {"provinceCode":"370211","provinceName":"广东省","cityCode":"370211","cityName":"深圳市","districtCode":"370211","districtName":"南山区","streetCode":"370211","streetName":"南新大道北200号","addressDetail":"珠山小一期","receiverPhone":"13013589803","receiver":"马老师"},

    @Schema(description = "省编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "370211")
    @JsonProperty("provinceCode")
    private String provinceCode;

    @Schema(description = "省名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "广东省")
    @JsonProperty("provinceName")
    private String provinceName;


    @Schema(description = "市编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "35236")
    @JsonProperty("cityCode")
    private String cityCode;

    @Schema(description = "市名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "深圳市")
    @JsonProperty("cityName")
    private String cityName;

    @Schema(description = "区编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "15256")
    @JsonProperty("districtCode")
    private String districtCode;

    @Schema(description = "区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "南山区")
    @JsonProperty("districtName")
    private String districtName;

    @Schema(description = "街道编码",  example = "125")
    @JsonProperty("streetCode")
    private String streetCode;

    @Schema(description = "街道名称",  example = "深南大道北99号")
    @JsonProperty("streetName")
    private String streetName;


    @Schema(description = "地址详情",    example = "南新大道北98号")
    @JsonProperty("addressDetail")
    private String addressDetail;

    @Schema(description = "收件人",  requiredMode = Schema.RequiredMode.REQUIRED,   example = "马老师")
    @JsonProperty("receiver")
    private String receiver;

    @Schema(description = "收件人电话号码",requiredMode = Schema.RequiredMode.REQUIRED,   example = "13800000012")
    @JsonProperty("receiverPhone")
    private String receiverPhone;


    @Override
    public String toString() {

        ObjectMapper mapper = new ObjectMapper();
        try {
            return mapper.writeValueAsString(this);
        } catch (
                Exception e) {
            e.printStackTrace();
        }

        return null;
    }


}